package com.maserb.monitor.repository;

import com.maserb.monitor.entity.JwOpenPolicyEntity;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface JwOpenPolicyRepository  extends JpaSpecificationExecutor<JwOpenPolicyEntity>
        , PagingAndSortingRepository<JwOpenPolicyEntity, String> {

    List<JwOpenPolicyEntity> findByTitle(String title);

    @Query(value = "select max(favorites) from JwOpenPolicyEntity ")
    Integer find();
}